<template>
  <el-input-number
      v-bind="vBind"
      v-model="formData[item.prop]"
      ref="component"
      :placeholder="placeholder"
      @change="isSearchEmitSearch(arguments,'change')"
      :class="{notShowControls}"
  ></el-input-number>
</template>

<script lang="ts">
import {ComsCommonMixin} from "../mixins/ComsCommonMixin";
export default {
  name: 'InputNumber',
  mixins:[ComsCommonMixin],
  computed:{
    placeholder(){
      if(this.disabled && this.formVm.disabledFormNotShowPlaceholder === true){
        return ''
      }
      return this.item.props?.placeholder || '请输入'+(this.item.label || '')
    },
    notShowControls() {
      return this.vBind?.controls === false;
    }
  },
  data() {
    return {
      isSearchEmitSearchEventName: 'change'
    }
  },
  methods: {
    initValue() {
      this.formData[this.item.prop] = ''
    }
  }
}
</script>

<style lang="scss" scoped>
.notShowControls{
  ::v-deep{
    .el-input{
      .el-input__inner{
        text-align: left;
      }
    }
  }
}
.el-input-number{
  width: 100%;
}
</style>
